package io.xxx.mario.task;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.xxx.mario.common.DateFormats;
import io.xxx.mario.message.MessageType;
import lombok.Data;
import org.apache.ibatis.type.EnumOrdinalTypeHandler;

import java.time.LocalDateTime;

@Data
public class PushRecord {

    @TableId
    private Long id;

    private Long taskPushRecordId;

    private Long taskId;

    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
    private ReceiverType receiverType;

    private Long receiverId;

    private Long taskMessageId;

    private Long messageId;

    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
    private MessageType messageType;

    private int messageSerialNo;

    private Long wxMessageId;

    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
    private PushStatus pushStatus;

    @JsonFormat(pattern = DateFormats.DEFAULT)
    private LocalDateTime createdTime;

    @JsonFormat(pattern = DateFormats.DEFAULT)
    private LocalDateTime updatedTime;
}
